package Sensitive_word_replacement_package;

public class Sensitive_word_replacement {
    public static void main(String[] args) {
        //1、获取到说的话
        String talk = "哎呀，TMD，真是操了，你真是个大傻逼！";

        //2、定义一个敏感词库
        String[] arr = {"TMD", "操", "大傻逼","SB"};

        //3、循环得到数组中的每一个敏感词，依次进行替换
        for (int i = 0; i < arr.length; i++) {
            //把里面的敏感词 TMD 替换成 ***
            talk = talk.replace(arr[i], "***");
        }

        //3、打印结果
        System.out.println(talk);
    }
}
